package com.pagonxt.hal.platform;

import android.os.RemoteException;

import com.pagonxt.hal.emv.emvService.IEMVInterface;
import com.pagonxt.hal.platform.service.IMainService;
import com.pagonxt.hal.platform.service.beeper.IBeeperService;
import com.pagonxt.hal.platform.service.camera.ICameraService;
import com.pagonxt.hal.platform.service.card.ICardService;
import com.pagonxt.hal.platform.service.encryption.IEncryptionInterface;
import com.pagonxt.hal.platform.service.info.IInfoService;
import com.pagonxt.hal.platform.service.init.IInitService;
import com.pagonxt.hal.platform.service.led.ILedService;
import com.pagonxt.hal.platform.service.maintenance.IMaintenanceInterface;
import com.pagonxt.hal.platform.modules.manager.IModuleManager;
import com.pagonxt.hal.platform.modules.manager.ModuleManager;
import com.pagonxt.hal.platform.service.mifare.IMifareService;
import com.pagonxt.hal.platform.service.printer.IPrinterService;
import com.pagonxt.hal.platform.service.stat.IStatService;

public class MainServiceImpl extends IMainService.Stub {

    private IModuleManager moduleManager;

    private MainServiceImpl(){
        moduleManager = ModuleManager.getInstance();
    }

    @Override
    public IInitService getInit() throws RemoteException {
        return moduleManager.getInit();
    }

    @Override
    public IPrinterService getPrinter() throws RemoteException {
        return moduleManager.getPrinter();
    }

    @Override
    public ILedService getLed() throws RemoteException {
        return moduleManager.getLed();
    }

    @Override
    public IBeeperService getBeeper() throws RemoteException {
        return moduleManager.getBeeper();
    }

    @Override
    public ICardService getCard() throws RemoteException {
        return moduleManager.getCard();
    }

    @Override
    public IMifareService getMifare() throws RemoteException {
        return moduleManager.getMifare();
    }

    @Override
    public ICameraService getCamera() throws RemoteException {
        return moduleManager.getCamera();
    }

    @Override
    public IInfoService getInfo() throws RemoteException {
        return moduleManager.getInfo();
    }

    @Override
    public IStatService getStatistic() throws RemoteException {
        return moduleManager.getStatistic();
    }

    @Override
    public IEMVInterface getEmv() throws RemoteException {
        return moduleManager.getEmv();
    }

    @Override
    public IMaintenanceInterface getMaintenance() throws RemoteException {
        return moduleManager.getMaintenance();
    }

    @Override
    public IEncryptionInterface getEncryption() throws RemoteException {
        return moduleManager.getEncryption();
    }

    static class Holder {
        private static final MainServiceImpl INSTANCE = new MainServiceImpl();
    }

    public static MainServiceImpl getInstance() {
        return Holder.INSTANCE;
    }
}
